package com.example.SocialApplication.activity.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.GridView;

import com.example.SocialApplication.R;
import com.example.SocialApplication.adapters.IconThingsAdapter;

import java.util.List;

public class ChooseIconThingDialog extends Dialog {

    public ChooseIconThingDialog(Context context, List<String> list, final IconThingInterface mInterface) {
        super(context);

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.color_spectrum_dialog);

        GridView view = (GridView) findViewById(R.id.gridView);

        final IconThingsAdapter adapter = new IconThingsAdapter(context, R.layout.color_spectrum_item, list);
        view.setAdapter(adapter);
        view.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                mInterface.onIconCLick(adapter.getItem(i));
            }
        });

    }
}
